from django.urls import path
from apps.recruit import views
from apps.recruit.views import EnterpriseCollectAPIView,EnterpriseUnCollectAPIView,RecruitCollectAPIView,RecruitUnCollectAPIView,EnterpriseVisit,SearchRecruitAPIView,RecruitVisit
from apps.recruit.views import RecruitDetailsModelViewSet
urlpatterns = [
    #访问次数
    path(r'enterprise/<pk>/visit/', EnterpriseVisit.as_view()),
    path(r'recruits/<pk>/visit/', RecruitVisit.as_view()),
    # path(r'recruits/<pk>/', RecruitDetailsModelViewSet.as_view({'get':'list'})),
    #收藏公司
    path(r'enterprise/<pk>/collect/', EnterpriseCollectAPIView.as_view()),
    path(r'enterprise/<pk>/cancelcollect/', EnterpriseUnCollectAPIView.as_view()),
    #收藏职业
    path(r'recruits/<pk>/collect/', RecruitCollectAPIView.as_view()),
    path(r'recruits/<pk>/cancelcollect/', RecruitUnCollectAPIView.as_view()),
    #搜所
    path(r'recruits/search/city/keyword/', SearchRecruitAPIView.as_view()),
]
from rest_framework.routers import DefaultRouter

#公司的路由
router = DefaultRouter()
#热门城市的显示
router.register('city/hotlist', views.HotCityModelViewSet,basename='hotlist')
# #热门公司的显示
router.register('enterprise/search/hotlist', views.EnterpriseModelViewSet,basename='hotlist')
#推荐职位的显示
router.register('recruits/search/recommend', views.RecruitModelViewSet,basename='recommend')
#最新职位的显示
router.register('recruits/search/latest', views.RecruitModelViewSet,basename='latest')
#职位详情
router.register('recruits',views.RecruitDetailsModelViewSet,basename='recruits')
#router.register('recruits/search/city/keyword/',views.RecruitDetailsModelViewSet,basename='latest')
#公司详情
router.register('enterprise',views.EnterpriseDetailsModdelViewSet,basename='enterprise')



urlpatterns += router.urls
